const http = require("http");
// 1.导入url模块
const url = require("url");

const server = http.createServer((request, response) => {
    //2. 解析request.url
    // console.log(request.url,'url');
    let res = url.parse(request.url,true);
    // 路径
    let pathName = res.pathname;
    // 查询字符串
    let keyword = res.query.keyword;
    console.log(keyword);
    response.end("url");
});

server.listen(9000, () => {
    console.log("服务已经启动....");
});
